<template>
	<view style="font-size: 50rpx;">
		扫码结果：{{result}}
	</view>
</template>

<script>
	const scanner = uni.requireNativePlugin('bo-plugin-scanner');
	export default {
		data() {
			return {
				result: '',
			}
		},
		onShow() {
			scanner.register({
				deviceType: '1'
			}, ({ result }) => {
				this.result = result;
			})
		},
		onHide() {
			scanner.unRegister();
		},
		onUnload() {
			scanner.unRegister();
		}
	}
</script>

<style></style>
